package cn.pn.project.mapper.base;

import cn.pn.project.pojo.base.City;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface CityMapper {
    /**
     * 查询全部城市
     * @return 全部城市集合
     */
    @Select("SELECT * FROM city WHERE fatherId>0;")
    List<City> listAllCity() throws Exception;

    /**
     * 根据cityId查询城市对象
     * @param cityId cityId
     * @return
     * @throws Exception
     */
    @Select("SELECT * FROM city WHERE cityId=#{cityId}")
    City getCityById(@Param("cityId") Integer cityId) throws Exception;
}
